package com.pdg.dungeondelver.engine;

public enum AtlasDirections {
	NORTH(0,-1),
	EAST(1,0),
	SOUTH(0,1),
	WEST(-1,0);
	private int deltaColumn;
	private int deltaRow;
	public int getDeltaColumn(){
		return deltaColumn;
	}
	public int getDeltaRow(){
		return deltaRow;
	}
	AtlasDirections(int theDeltaColumn,int theDeltaRow){
		deltaColumn = theDeltaColumn;
		deltaRow = theDeltaRow;
	}
	public AtlasDirections next(){
		if(this==NORTH){
			return EAST;
		}else if(this==EAST){
			return SOUTH;
		}else if(this==SOUTH){
			return WEST;
		}else{
			return NORTH;
		}
	}
	public AtlasDirections previous(){
		if(this==NORTH){
			return WEST;
		}else if(this==EAST){
			return NORTH;
		}else if(this==SOUTH){
			return EAST;
		}else{
			return WEST;
		}
	}
	public AtlasDirections opposite(){
		if(this==NORTH){
			return SOUTH;
		}else if(this==EAST){
			return WEST;
		}else if(this==SOUTH){
			return NORTH;
		}else{
			return EAST;
		}
	}
	public int getNextColumn(int startColumn,int startRow){
		return startColumn + deltaColumn;
	}
	public int getNextRow(int startColumn, int startRow){
		return startRow + deltaRow;
	}
	public static AtlasDirections[] getDirections(){
		return new AtlasDirections[]{ NORTH,EAST,SOUTH,WEST };
	}
}
